sysroot: [scan-build]: Remove a dead assignment
authorColin Walters <walters@verbum.org>
Mon, 14 Oct 2019 14:20:44 +0000 (14:20 +0000)
committerColin Walters <walters@verbum.org>
Tue, 15 Oct 2019 12:41:27 +0000 (12:41 +0000)
Clarify the conditionals here and remove a dead assignment.

src/libostree/ostree-sysroot-deploy.c

index c342d7e0042e21d42ee038a43ebc32ffdbb19462..6507b2c57f4bde01f7e004ad5cf141dcc45d5b4f 100644 (file)
@@ -753,15 +753,14 @@ prepare_deployment_etc (OstreeSysroot         *sysroot,
     return FALSE;
   gboolean usretc_exists = (errno == 0);
 
-  if (etc_exists && usretc_exists)
-    return glnx_throw (error, "Tree contains both /etc and /usr/etc");
-  else if (etc_exists)
+  if (etc_exists)
     {
+       if (usretc_exists)
+         return glnx_throw (error, "Tree contains both /etc and /usr/etc");
       /* Compatibility hack */
       if (!glnx_renameat (deployment_dfd, "etc", deployment_dfd, "usr/etc", error))
         return FALSE;
       usretc_exists = TRUE;
-      etc_exists = FALSE;
     }
 
   if (usretc_exists)